package com.settlement.system.service.impl;

import com.settlement.system.mapper.BaseMapper;
import com.settlement.system.mapper.CompanyPartConfigMapper;
import com.settlement.system.common.exception.ServiceException;
import com.settlement.system.model.entity.common.CompanyPartConfig;
import com.settlement.system.service.CompanyPartConfigService;
import org.springframework.stereotype.Service;

import jakarta.annotation.Resource;

/**
 * 结算公司分区配置表 服务实现类
 * @author Ximi
 * @since 2020-04-08
 */
@Service
public class CompanyPartConfigServiceImpl extends BaseServiceImpl implements CompanyPartConfigService {

    @Resource
    private CompanyPartConfigMapper companyPartConfigMapper;

    @Override
    public BaseMapper init() {
        return companyPartConfigMapper;
    }

    /**
     * 获取公司的大区配置
     * @param companyNo
     * @return
     * @throws ServiceException
     */
    @Override
    public CompanyPartConfig getCompanyPartConfig(String companyNo) throws ServiceException {
        try {
            return companyPartConfigMapper.getCompanyPartConfig(companyNo);
        } catch (Exception e) {
            throw new ServiceException("",e);
        }
    }

}

